<template>
  <div >
    <router-view></router-view>
    <div style="margin-top: 40px" v-show="$route.meta.istrun">
      <t-tab-bar v-model="value" theme="tag" :split="false">
        <t-tab-bar-item v-for="item in list" :key="item.value" :value="item.value" @click="tz(item.path)">
          <template #icon>
            <t-icon :name="item.icon" />
          </template>
        </t-tab-bar-item>
      </t-tab-bar>
    </div>
  </div>
</template>

<script setup>
import { onMounted,ref } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter();
const value = ref('label_1');
const list = ref([
  { value: 'label_1', icon: 'task-add-1', path: '/plan' },
  { value: 'label_2', icon: 'wink', path: '/emo' },
  { value: 'label_3', icon: 'book', path: '/diary'},
  { value: 'label_4', icon: 'user', path: '/my' },
]);

onMounted(()=>{
  router.push('/plan');
})
const tz = (path) => {
  router.push(path);
};

</script>

<style scoped>

</style>